package com.ride.dao.impl;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.ride.dao.RideSearchDao;
import com.ride.model.RideSearch;
import org.springframework.stereotype.Repository;

/**
 * @version $LastChangedRevision: 15 $
 *          <p/>
 *          $LastChangedBy: marcel.menze@gmail.com $
 *          <p/>
 *          $LastChangedDate: 2011-04-03 13:43:25 +0000 (Sun, 03 Apr 2011) $
 */
@Repository
public class RideSearchDaoImpl implements RideSearchDao {

    @PersistenceContext(name = "ride")
    private EntityManager em;

    @Override
    public RideSearch findById(Long id) {
        return em.find(RideSearch.class, id);
    }

    @Override
    public void persist(RideSearch rideSearch) {
        em.persist(rideSearch);
    }

    @Override
    public void update(RideSearch rideSearch) {
        em.merge(rideSearch);
    }

    @Override
    public void delete(RideSearch rideSearch) {
        em.remove(rideSearch);
    }
}
